using System;
using System.Collections.Generic;
using System.Text;
using JobShopModel.Events;
using Extern.Tools;

//TODO Document the class !
//TODO Verify if IEvent is correclty implemented as a comparable object....
namespace JobShopModel.Model.FactoryLvl
{
    class EventQueue
    {
        private BinaryPriorityQueue queue;

        public EventQueue()
        {
            this.queue = new BinaryPriorityQueue();
        }

        public void insertEvent(IEvent events){
            queue.Push(events);
        }

        /// <summary>
        /// Get the smallest event and remove it from the queue
        /// </summary>
        /// <returns></returns>
        public IEvent nextEvent()
        {
            return (IEvent)queue.Pop();
        }

        /// <summary>
        /// Get the smallest event without removing it from the queue
        /// Should it be ever used ?? 
        /// Set to protected for the moment...
        /// </summary>
        /// <returns></returns>
        protected IEvent peekEvent()
        {
            return (IEvent)queue.Peek();
        }
    
    }
}


